<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>抽奖系统管理后台 - 登录</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background: linear-gradient(to right, #4a90e2, #357abd);
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .login-container {
            background: white;
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 400px;
        }
        .login-title {
            text-align: center;
            margin-bottom: 30px;
            color: #333;
        }
        .form-control {
            height: 45px;
            margin-bottom: 20px;
        }
        .btn-login {
            height: 45px;
            background: #4a90e2;
            border: none;
            width: 100%;
        }
        .btn-login:hover {
            background: #357abd;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <h2 class="login-title">抽奖系统管理后台</h2>
        <form id="loginForm">
            <div class="mb-3">
                <input type="text" class="form-control" id="username" placeholder="用户名" required>
            </div>
            <div class="mb-3">
                <input type="password" class="form-control" id="password" placeholder="密码" required>
            </div>
            <button type="submit" class="btn btn-primary btn-login">登录</button>
        </form>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script>
        $(document).ready(function() {
            $('#loginForm').on('submit', function(e) {
                e.preventDefault();
                var username = $('#username').val();
                var password = $('#password').val();
                
                if (username === 'admin' && password === '123456') {
                    localStorage.setItem('isLoggedIn', 'true');
                    window.location.href = '/api/lottery/admin/index';
                } else {
                    alert('用户名或密码错误！');
                }
            });
        });
    </script>
</body>
</html> 